
#ifndef _DMC_CONFIG_H_
#define _DMC_CONFIG_H_

	#define intptr_t int
	#define _EVENT_ssize_t	int
	#define _EVENT_socklen_t	int
	
	typedef unsigned int	ULONG_PTR;
	typedef unsigned int	HCRYPTPROV;
	
	#define CRYPT_VERIFYCONTEXT     0xF0000000
	#define CRYPT_NEWKEYSET         0x00000008
	#define CRYPT_DELETEKEYSET      0x00000010
	#define CRYPT_MACHINE_KEYSET    0x00000020
	#define CRYPT_SILENT            0x00000040

	#define PROV_RSA_FULL           1
	#define PROV_RSA_SIG            2
	#define PROV_DSS                3
	#define PROV_FORTEZZA           4
	#define PROV_MS_EXCHANGE        5
	#define PROV_SSL                6
	#define PROV_RSA_SCHANNEL       12
	#define PROV_DSS_DH             13
	#define PROV_EC_ECDSA_SIG       14
	#define PROV_EC_ECNRA_SIG       15
	#define PROV_EC_ECDSA_FULL      16
	#define PROV_EC_ECNRA_FULL      17
	#define PROV_DH_SCHANNEL        18
	#define PROV_SPYRUS_LYNKS       20
	#define PROV_RNG                21
	#define PROV_INTEL_SEC          22

	
	#define LUP_DEEP                0x0001
	#define LUP_CONTAINERS          0x0002
	#define LUP_NOCONTAINERS        0x0004
	#define LUP_NEAREST             0x0008
	#define LUP_RETURN_NAME         0x0010
	#define LUP_RETURN_TYPE         0x0020
	#define LUP_RETURN_VERSION      0x0040
	#define LUP_RETURN_COMMENT      0x0080
	#define LUP_RETURN_ADDR         0x0100
	#define LUP_RETURN_BLOB         0x0200
	#define LUP_RETURN_ALIASES      0x0400
	#define LUP_RETURN_QUERY_STRING 0x0800
	#define LUP_RETURN_ALL          0x0FF0
	#define LUP_RES_SERVICE         0x8000

	#define LUP_FLUSHCACHE          0x1000
	#define LUP_FLUSHPREVIOUS       0x2000

	#define LUP_NON_AUTHORITATIVE   0x4000
	#define LUP_SECURE              0x8000
	#define LUP_RETURN_PREFERRED_NAMES  0x10000

	#define LUP_ADDRCONFIG          0x00100000
	#define LUP_DUAL_ADDR           0x00200000
	
	/*
	 * Return flags
	 */

	#define  RESULT_IS_ALIAS      0x0001
	#if(_WIN32_WINNT >= 0x0501)
	#define  RESULT_IS_ADDED      0x0010
	#define  RESULT_IS_CHANGED    0x0020
	#define  RESULT_IS_DELETED    0x0040
	#endif //(_WIN32_WINNT >= 0x0501)
	#define AI_PASSIVE      0x00000001  // Socket address will be used in bind() call
	#define AI_CANONNAME    0x00000002  // Return canonical name in first ai_canonname
	#define AI_NUMERICHOST  0x00000004  // Nodename must be a numeric address string
	#define AI_NUMERICSERV  0x00000008  // Servicename must be a numeric port number

	#define AI_ALL          0x00000100  // Query both IP6 and IP4 with AI_V4MAPPED
	#define AI_ADDRCONFIG   0x00000400  // Resolution only if global address configured
	#define AI_V4MAPPED     0x00000800  // On v6 failure, query v4 and convert to V4MAPPED format

	#define AI_NON_AUTHORITATIVE        LUP_NON_AUTHORITATIVE       // 0x4000
	#define AI_SECURE                   LUP_SECURE                  // 0x8000
	#define AI_RETURN_PREFERRED_NAMES   LUP_RETURN_PREFERRED_NAMES  // 0x10000
	
	#define   _SS_MAXSIZE   128						//   Maximum   size.
	#define   _SS_ALIGNSIZE   (sizeof(__int64))		//   Desired   alignment.
	#define   _SS_PAD1SIZE   (_SS_ALIGNSIZE   -   sizeof   (short))
	#define   _SS_PAD2SIZE   (_SS_MAXSIZE   -   (sizeof   (short)   +   _SS_PAD1SIZE  +   _SS_ALIGNSIZE))
	
	
	typedef struct sockaddr_storage {
		short   ss_family;
		char    __ss_pad1[_SS_PAD1SIZE];
		__int64 __ss_align;
		char    __ss_pad2[_SS_PAD2SIZE];
	} SOCKADDR_STORAGE, *PSOCKADDR_STORAGE ;

	
	#define NI_MAXSERV 32
	#define NI_MAXHOST 1025
	#define NI_NUMERICHOST 1
	#define NI_NUMERICSERV 2
	
	#define _strtoi64	strtol
#endif
	
#undef	_EVENT_HAVE_GETADDRINFO
#undef	_EVENT_HAVE_GETNAMEINFO
#undef	_EVENT_HAVE_STRUCT_ADDRINFO
#undef	_EVENT_HAVE_STRUCT_IN6_ADDR
#undef	_EVENT_HAVE_STRUCT_IN6_ADDR_S6_ADDR16
#undef	_EVENT_HAVE_STRUCT_IN6_ADDR_S6_ADDR32
#undef	_EVENT_HAVE_STRUCT_SOCKADDR_IN6
